//
//  VisitorView.swift
//  JIMWeiBo
//
//  Created by 陈恒均 on 2018/2/9.
//  Copyright © 2018年 陈恒均. All rights reserved.
//

import UIKit

class VisitorView: UIView {

    class func visitorView() -> VisitorView {
        let visitorView = Bundle.main.loadNibNamed("VisitorView", owner: nil, options: nil )?.first as! VisitorView
        return visitorView
        
    }
// MARK:- 控件的属性
    @IBOutlet weak var rotationView: UIImageView!
    @IBOutlet weak var iconView: UIImageView!
    @IBOutlet weak var tipLabel: UILabel!
    @IBOutlet weak var registerBtn: UIButton!
    
    @IBOutlet weak var LoginBtn: UIButton!
    // MARK:- 自定义函数
    func setupVisitorViewInfo(iconName:String , title:String) {
        iconView.image = UIImage(named: iconName)
        tipLabel.text = title
        rotationView.isHidden = true
    }
    
    func addRotationAnmi() {
        
        let rotationAnmi = CABasicAnimation(keyPath: "transform.rotation.z")
        
        rotationAnmi.fromValue = 0
        rotationAnmi.toValue = Double.pi * 2
        rotationAnmi.repeatCount = MAXFLOAT
        rotationAnmi.duration = 5
        rotationAnmi.isRemovedOnCompletion = false
        
        rotationView.layer.add(rotationAnmi, forKey: nil)
        
    }
}
